fix: NetworkVariable subclasses not generating serialization code#2421
Merged
ShadauxCat merged 3 commits intodevelopfrom Mar 9, 2023
Merged
fix: NetworkVariable subclasses not generating serialization code#2421ShadauxCat merged 3 commits intodevelopfrom
ShadauxCat merged 3 commits intodevelopfrom
Conversation
samlucas-unity
approved these changes
Mar 1, 2023
| { | ||
| var genericType = (GenericInstanceType)baseType; | ||
| var newGenericType = new GenericInstanceType(baseType.Resolve()); | ||
| for (var i = 0; i < genericType.GenericArguments.Count; ++i) |
Contributor
There was a problem hiding this comment.
More a question than a comment on the code :). Is there a reason you're not using foreach apart from this is your preferred way to iterate? I'm just wondering if there are reasons not to use it which I'm not aware of?
Collaborator
Author
There was a problem hiding this comment.
um... if you look at the code below, in the next loop, it's accessing two different arrays with the same index. I think when I originally wrote this loop, it was doing the same thing, so I was using C-style for to be able to have access to the index value for the other array. At some point I think I realized this loop doesn't need it and removed the other access, but didn't change the loop style.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ILPP didn't know how to identify subclasses when looking for the list of wrapped types to generate serialization code for.
fixes #2385
MTT-5503
Changelog
NetworkVariablefailing to generate serialization code unless a normalNetworkVariableof the same wrapped type existed somewhere else in the code.Testing and Documentation